package com.woniuxy.controller;

import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.entity.StuPaper;
import com.woniuxy.service.IStuPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author ylr
 * @time 2022/06/13 20:22:02
 */
@RestController
@RequestMapping("exam")
public class StuPaperController {

    @Autowired
    IStuPaperService stuPaperService;

    @RequestMapping("examing")
    public ResponseEntity addStuPaper(@RequestBody Map stuPaper){
        return new ResponseEntity(stuPaperService.addStuPaper(stuPaper));
    }

    @RequestMapping("findexam/{uid}/{pid}")
    public ResponseEntity findStuPaper(@PathVariable int uid, @PathVariable int pid){
        return new ResponseEntity(stuPaperService.findStuPaper(uid, pid));
    }

}
